//
//  JLXXDefine.h
//  Pods
//
//  Created by apple on 2017/5/26.
//
//

#ifndef JLXXDefine_h
#define JLXXDefine_h

// 图片路径
static inline NSString * getImagePathInFrameworks (Class currentCls, NSString *imageName) {
    NSBundle *currentBundle = [NSBundle bundleForClass:currentCls];
    NSString *currentBundleName = [currentBundle infoDictionary][@"CFBundleName"];
    NSString *currentRescouceBundlePath = [currentBundleName stringByAppendingString:@".bundle"];
    NSString *currentFrameWork = [[[currentBundle bundlePath] componentsSeparatedByString:@"/"] lastObject];
    NSString *path = [@"Frameworks" stringByAppendingPathComponent:currentFrameWork];
    NSString *imageBundlePath = [path stringByAppendingPathComponent:currentRescouceBundlePath];
    NSString *imagePath = [imageBundlePath stringByAppendingPathComponent:imageName];
    return imagePath;
}

#define dataBasePath ([NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) [0] stringByAppendingPathComponent:@"sstv.sqlite"])

#define kYZGiOS10OrLater ([[UIDevice currentDevice].systemVersion floatValue] >= 10.0)

#define KWeakSelf __weak typeof(self) ws = self
#define KStrongSelf __strong typeof(self) strongSelf = self
#define RGB_COLOR(r,g,b,a) ([UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:a])
#define kFont(fontSize) [UIFont systemFontOfSize:fontSize]

#define KKeyWindow [UIApplication sharedApplication].keyWindow

#ifdef DEBUG
#define YZGLog(...) NSLog(__VA_ARGS__)
#else
#define YZGLog(...)
#endif

#define KTopOriginal (self.navigationController.navigationBar.bounds.size.height +[[UIApplication sharedApplication] statusBarFrame].size.height)


#define KStatusBarHeight ([[UIApplication sharedApplication] statusBarFrame].size.height)

#define KNavBarHeight (44.0)

#define KStatusBarAndNavBarHeight (KStatusBarHeight + KNavBarHeight)

#define KTabBarHeight  (self.tabBarController.tabBar.bounds.size.height)

//屏幕宽高...
#define KScreenWidth    [UIScreen mainScreen].bounds.size.width
#define KScreenHeight    [UIScreen mainScreen].bounds.size.height
#define KHadTabBarAndNavBarViewHeight    (KScreenHeight-KStatusBarHeight-KNavBarHeight-KTabBarHeight)
#define KOnlyHadNavBarViewHeight    (KScreenHeight-KStatusBarHeight-KNavBarHeight)
#define KOnlyHadTabBarViewHeight    (KScreenHeight-KTabBarHeight)


//竖屏  相对iphone6 屏幕比
#define KWidthScale  ([UIScreen mainScreen].bounds.size.width/375.0f)
#define KHeightScale  ([UIScreen mainScreen].bounds.size.height/667.0f)
//竖屏  相对iphone5s 屏幕比
#define k5sWidthScale  ([UIScreen mainScreen].bounds.size.width/320.0f)
#define k5sHeightScale  ([UIScreen mainScreen].bounds.size.height/568.0f)

//setting...
#define kNavColor ([UIColor colorWithHexString:@"ff8b27"])
#define kNavDarkColor ([UIColor colorWithHexString:@"000"])


#endif /* JLXXDefine_h */
